import { combineReducers } from "redux";
import { GET_AWARD_LIST, GET_AWARD_DETAIL } from "../actions";

const awardListReducer = (
  state = { awardList: [], awardDetail: {} },
  action
) => {
  switch (action.type) {
    case GET_AWARD_LIST: {
      return {
        ...state,
        awardList: action.awardList
      };
    }
    case GET_AWARD_DETAIL: {
      return {
        ...state,
        awardDetail: action.awardDetail
      };
    }
    default:
      return state;
  }
};

const rootReducer = combineReducers({
  awardListReducer
});

export default rootReducer;
